drop table if exists jms_ods.tab_booking_space ;
create EXTERNAL TABLE if not exists jms_ods.tab_booking_space(
BOOKING_SPACE_NO bigint comment "订舱号",
FLIGHT_NO string comment "航班号",
FLIGHT_DATE timestamp comment "航班日期",
ORIGIN_AIRPORT string comment "始发机场",
ORIGIN_AGENT_AREA_ID bigint comment "始发代理区id",
ORIGIN_AGENT_AREA_CODE string comment "",
ORIGIN_AGENT_AREA_NAME string comment "始发代理区name",
ORIGIN_CENTER_ID bigint comment "始发转运中心id",
ORIGIN_CENTER_CODE string comment "始发转运中心code",
ORIGIN_CENTER_NAME string comment "始发转运中心name",
DESTINATION_AIRPORT string comment "目的地机场",
DESTINATION_CENTER_ID bigint comment "目的地转运中心id",
DESTINATION_CENTER_CODE string comment "目的地转运中心code",
DESTINATION_CENTER_NAME string comment "目的地转运中心name",
TAKE_OFF_TIME timestamp comment "计划起飞时间",
LANDING_TIME timestamp comment "计划落地时间",
SUPPLIER_NAME string comment "供应商",
SUPPLIER_SERVICE_TYPE_NAME string comment "供应商服务类型",
GOODS_QUANTITY int comment "货物件数",
GOODS_WEIGHT double comment "货物重量",
SUPPLIER_QUOTATION double comment "供应商报价",
DELIVERY_SCENARIO string comment "发运场景",
APPLY_REASON string comment "申请原因",
DELIVERY_NUM int comment "转运交件件数",
DELIVERY_WEIGHT double comment "转运交件重量",
DELIVERY_TIME timestamp comment "转运交件时间",
REGISTRATION_USER_CODE string comment "订舱信息登记人code",
REGISTRATION_USER_NAME string comment "订舱信息登记人",
REGISTRATION_TIME timestamp comment "登记时间",
STATUS smallint comment "状态 1已使用 2未使用"
)
    COMMENT  '订舱查询'
    PARTITIONED BY (dt STRING COMMENT '时间分区')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_ods.db/external/tab_booking_space'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

msck repair table jms_ods.tab_booking_space ;

